require(["../conf/config.js"],function(){
	require(["jquery"],function($){
		$(function(){
			
			$.ajax({
				//url : "../ajax/explor.text",
				url : "http://localhost:8000/ajax/explor.text",
				dataType : "json",
				type : "get",
				success : function(mess){
					mess.forEach((item,index)=>{
						let data = document.getElementsByClassName("data")[0];
						let data1 = document.getElementsByClassName("data3")[0];
						let data2 = document.getElementsByClassName("data4")[0];
						let data3 = document.getElementsByClassName("data5")[0];
						let a = item.url1;
						let b = item.url2;
						let doc =`<div class="box">
									<img src="${a}" alt="">
									<img src="${b}" alt="">
								</div>`;
								if(index==0){
									data.innerHTML += doc;
								}else if(index==1){
									data1.innerHTML += doc;
								}else if(index ==2){
									data2.innerHTML += doc;
								}else{
									data3.innerHTML +=doc;
								}
					})
				}
			})//ajax请求
			
			$.ajax({
				//url : "../ajax/explor.text",
				url : "http://localhost:8000/ajax/explor2.text",
				dataType : "json",
				type : "get",
				success : function(mess){
					mess.forEach((item,index)=>{
						let data = document.getElementsByClassName("data1")[0];
						let data1 = document.getElementsByClassName("data2")[0];
						let a = item.url1;
						let b = item.url2;
						let c = item.price;
						let doc =`<div class="box1">
									<img src="${a}" alt="">
									<img src="${b}" alt="">
									<div class="box1_price">
										<p><span>￥</span>${c}</p>
										<button>立即订购<span>></span></button>
									</div>
								</div>`;
								if(index==0){
									data.innerHTML += doc;
								}else{
									data1.innerHTML += doc;
								}
						
					})
				}
			})//ajax请求2
			
			
			$("footer").load("../pages/foot.html"); //引入底部
			//最外层三个括号
		})
	})
})